home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Bitmap Libraries 2.0 / Lisp Interface / BitMapLisp.txt < prev    next >
Text File  |  1996-03-10  |  45KB  |  1,412 lines

  1. file BitMapLisp.txt Copyright (C) 1996 by John Montbriand.  All Rights Reserved.
  2.  
  3. ABOUT BITMAP...
  4.  
  5.     Copyright (C) 1996 by John Montbriand.  All Rights Reserved.
  6.     
  7.     Distribute freely in areas where the laws of copyright apply.
  8.  
  9.     Use at your own risk.
  10.     
  11.     Do not distribute modified copies.
  12.  
  13.     These various BitMap libraries are for free!
  14.  
  15.     This file describes the Macintosh Common Lisp interface
  16.     to the bitmap routines.
  17.  
  18.  
  19. ABOUT THE AUTHOR...
  20.  
  21.     Comments, questions, or suggestions are always welcome.
  22.  
  23.     John Montbriand                tinyjohn@sasknet.sk.ca
  24.     P.O. Box. 1133
  25.     Saskatoon Saskatchewan Canada
  26.     S7K 3N2
  27.  
  28.  
  29. WHY IS IT FOR FREE?
  30.  
  31.     none of your business,
  32.     
  33.     but if you have some business for me,  I'll see what I can do..
  34.  
  35.  
  36. OUTLINE OF TOPICS
  37.  
  38.     INSTALLATION INSTRUCTIONS
  39.     BITMAPS, WHAT ARE THEY?
  40.     IMPLEMENTATION NOTES
  41.     MATERIALS
  42.     LEGAL STUFF
  43.     FURTHER REFERENCE
  44.     SERVICES PROVIDED (OVERVIEW)
  45.     BE CAREFUL (CAVEATS)
  46.     OTHER COOL THINGS YOU CAN DO
  47.     OVERVIEW OF ROUTINES
  48.     SPECIFIC ROUTINE DESCRIPTIONS
  49.  
  50.  
  51. INSTALLATION INSTRUCTIONS
  52.  
  53.     To install the bitmaps package in your system, move the files
  54.     BitMaps.lisp and BitMapsLib.o (found in the folder entitled
  55.     'Library Folder Stuff') into the 'Library' folder inside of the
  56.     MCL directory.
  57.  
  58.     Once this has been done, the bitmaps package can be conveniently
  59.     loaded and imported into the current package using the following
  60.     commands:
  61.  
  62.         (require :bitmaps)
  63.         (use-package :bitmaps)
  64.     
  65.     see the file BitMapExamples.lisp for an example of how to load
  66.     the bitmaps package once it has been correctly installed in the
  67.     Library folder.
  68.  
  69.  
  70. BITMAPS, WHAT ARE THEY?
  71.     
  72.     Well, they're like little black and white computer screens in memory
  73.     that you can do drawing in before transfering the images you
  74.     draw on them to the screen.  Drawing things off screen and then
  75.     placing them on screen creates the feel of instantaneous, flicker
  76.     free drawing.
  77.     
  78.     BitMaps are a data structure used to store black and white images
  79.     off-screen.  You can use quickdraw to draw directly into bitmaps
  80.     and create images for placement on the screen, or you can take
  81.     images from the screen, place them in a bitmap, do various
  82.     transformations to them, and then put them back on the screen.
  83.     
  84.     QuickDraw GrafPorts draw into BitMap structures, and, as a matter
  85.     of fact, all screen drawing on early macintoshes was implemented
  86.     through BitMaps that were memory mapped to the screen hardware.
  87.     
  88.     The big advantage:  BitMaps provide a way to do simple high quality
  89.     graphics while at the same time requiring very little memory.
  90.  
  91.  
  92. IMPLEMENTATION NOTES
  93.  
  94.     This implementation stores each bitmap in a single, contiguous,
  95.     non-relocatable memory block refered to using a pointer.  The first
  96.     14 bytes of the memory block contain the Bitmap data structure,
  97.     while the remaining bytes are used to store the raster data.
  98.  
  99.  
  100. MATERIALS
  101.  
  102.     The BitMap format itself is the copyright property of Apple
  103.     computer and has been known to the public since 1983.
  104.     
  105.     The routines documented herein are the copyright property of
  106.     John Montbriand.  I am making these routines available to the
  107.     macintosh programming community because I feel it's about time
  108.     someone did!  They're fun, easy to use, and practical.  I hope
  109.     all who find them will use them well.
  110.  
  111.     Compiled and tested with MPW C, MWC, SC, MrC, MPW PPC, MCL2, MCL3.
  112.  
  113.  
  114. LEGAL STUFF
  115.  
  116.     These libraries are provided for free and you may use them
  117.     in any program you make;  however, if you're particular about
  118.     having signed documentation that proves this fact in your posession
  119.     then, as I would like to ensure these libraries are widely used,
  120.     I would be glad provide such documents for you.
  121.     
  122.     I don't think this is entirly necessary, but I can understand
  123.     that some folks feel quite strongly about such issues and prefer
  124.     to do things in writing.
  125.     
  126.     If you would like for me to send you a signed document saying
  127.     that you have license to use these routines in your programs,
  128.     then send me a couple of bucks to cover postage and handling
  129.     and I'll send you back a signed letter saying you have license
  130.     to use these routines in any software you make.
  131.     
  132.     I think two or three dollars is fair as I don't really get a big
  133.     thrill out of printing stuff out and mailing it, and that's usually
  134.     enough to cover postage to anywhere in the world.  I s'pose you'd have
  135.     to figure out how much it would cost for me to mail a letter to you
  136.     from here in Canada.
  137.  
  138.  
  139. FURTHER REFERENCE
  140.  
  141.     BitMap.h and BitMap.c contain routines for accessing and manipulating
  142.     BitMap data stored in pointers.  For more information about BitMaps,
  143.     offscreen drawing, pointers, C, etc..  refer to the following sources:
  144.     
  145.     "Bitmaps" (2-9) in the "Basic QuickDraw" chapter of Inside Macintosh:
  146.     Imaging With QuickDraw by Apple Computer, Inc.  Addison-Wesley.
  147.         A discussion of the Bitmap data structure and how it applies to
  148.         GrafPorts.
  149.         
  150.     "Boolean Transfer Modes With 1-Bit Pixels" (3-8) in the "QuickDraw Drawing"
  151.     chapter of Inside Macintosh: Imaging With QuickDraw by Apple Computer,
  152.     Inc.  Addison-Wesley.
  153.         BitMaps are 1-Bit Pixel data structures.  This part discusses the
  154.         various transfer modes you can use while drawing into BitMaps.
  155.     
  156.     "Copying Bits Between Graphics Ports" (3-32) in the "QuickDraw Drawing"
  157.     chapter of Inside Macintosh: Imaging With QuickDraw by Apple
  158.     Computer, Inc.  Addison-Wesley.
  159.         A discussion of the Bitmap data structure and how it applies to
  160.         GrafPorts.
  161.         
  162.     "Copying Images" (3-112) in the "QuickDraw Drawing" chapter of
  163.     Inside Macintosh: Imaging With QuickDraw by Apple
  164.     Computer, Inc.  Addison-Wesley.
  165.         A discussion of the CopyBits routine and the various parameter
  166.         combinations you can use with it.  This is followed by
  167.         a discussion of the CopyMask routine.
  168.  
  169.     Technical note #163 "Adding Color With CopyBits" by Chris Derossi
  170.         A discussion of how to draw in colour using bitmaps.
  171.     
  172.     Technical note #193 "So Many Bitmaps, So Little Time" by Rick Blair
  173.         A look at the BitMapToRegion routine.
  174.     
  175.     Technical note #41 "Drawing Into an Offscreen Bitmap" by
  176.     Jim Friedlander & Ginger Jernigan
  177.         A talk about offscreen bitmaps, and how to use them.
  178.     
  179.     Inside Macintosh: Memory by Apple Computer, Inc.  Addison-Wesley.
  180.         A discussion of memory managment, pointers, what they are, and
  181.         how to use them.
  182.     
  183.     The C Programming Language 2nd edition by Brian W. Kernighan
  184.         and Dennis M. Ritchie.  Prentice Hall.
  185.     
  186.     Macintosh Common Lisp Reference
  187.  
  188.     Common Lisp 2nd edition by Guy L. Steele Jr. Digital Press.
  189.  
  190.     Comments for the routines provided herein have been included in the
  191.     file BitMap.h.
  192.     
  193.     Also, there is a 411 help file.
  194.     
  195.  
  196. SERVICES PROVIDED (OVERVIEW)
  197.  
  198.     - routines for creating bitmap structures in memory.
  199.     
  200.     - rotate functions for rotating bitmaps 90 degrees left and right,
  201.     
  202.     - flip functions for flipping bitmap data both vertically
  203.     and horizontally,
  204.     
  205.     - a trace edges routine for tracing the edges of an image,
  206.     
  207.     - a rotation routine for rotating a bitmap to a particular angle,
  208.     
  209.     - a routine for duplicating bitmaps,
  210.     
  211.     - a routine for comparing bitmaps,
  212.     
  213.     - routines providing the painbucket tool and lasso tool effects,
  214.     
  215.     - transfer routines for transfering bitmap data to and from the
  216.     PICT format,
  217.     
  218.     - a complete set of logical operations on bitmaps,
  219.     
  220.     - a complete set of pixel oriented routines for testing, setting,
  221.     clearing, and toggling individual pixels in bitmaps,
  222.     
  223.     - routines and a macro allowing you to quickly and easily draw
  224.     into bitmaps,
  225.     
  226.     - routines for copying bitmap images to the current grafport,
  227.  
  228.  
  229. BE CAREFUL (CAVEATS)
  230.  
  231.     I think these routines are safe to use, but you should do your own
  232.     testing.  I have provided the source code, and if you find any bugs,
  233.     please let me know right away so I can provide corrections in
  234.     future versions.
  235.     
  236.     I advertise a finder's fee of $10.00 cash for errors in any
  237.     of my products.
  238.  
  239.  
  240. OTHER COOL THINGS YOU CAN DO
  241.  
  242.     bitmaps provide a convenient, storage efficient way to
  243.     implement zero - one adjacency matrices that are incredibly
  244.     useful for working with directed graphs.
  245.  
  246.  
  247. OVERVIEW OF ROUTINES
  248.  
  249.     creating your own bitmaps:
  250.         (new-bitmap width height) -> a bitmap
  251.         (kill-bitmap bitmap &rest other-bitmaps)
  252.     
  253.     rotating a bitmap image 90 degrees to the left or to the right:
  254.         (rotate-bitmap-right bitmap) -> a bitmap
  255.         (rotate-bitmap-left bitmap) -> a bitmap
  256.    
  257.     flipping a bitmap image horizontally or vertically:
  258.         (flip-bitmap-vertically bitmap) -> a bitmap
  259.         (flip-bitmap-horizontally bitmap) -> a bitmap
  260.    
  261.     rotating a bitmap image to a particular angle:
  262.         (rotate-bitmap bitmap h-center v-center angle) -> a bitmap
  263.  
  264.     duplicating a bitmap:
  265.         (duplicate-bitmap bitmap) -> a bitmap
  266.         
  267.     the paint bucket function:
  268.         (paint-bucket-bitmap bitmap h v) -> a bitmap
  269.     
  270.     the lasso function:
  271.         (lasso-bitmap bitmap) -> a bitmap
  272.  
  273.     the trace edges function:
  274.         (trace-bitmap-edges bitmap) -> a bitmap
  275.  
  276.     transfer functions for converting to and from the PICT format:
  277.         (picture-to-bitmap bitmap) -> a bitmap
  278.         (bitmap-to-picture bitmap) -> a picture
  279.     
  280.     logical operations on bitmaps:
  281.         (and-bitmaps bitmap-a bitmap-b) -> a bitmap
  282.         (or-bitmaps bitmap-a bitmap-b) -> a bitmap
  283.         (xor-bitmaps bitmap-a bitmap-b) -> a bitmap
  284.         (complement-bitmap bitmap) -> a bitmap
  285.     
  286.     comparison:
  287.         (equal-bitmaps bitmap-a bitmap-b) -> T or NIL
  288.     
  289.     pixel oriented functions:
  290.         (test-bitmap-pixel bitmap x y) -> T or NIL
  291.         (set-bitmap-pixel bitmap hpos vpos)
  292.         (clear-bitmap-pixel bitmap hpos vpos)
  293.         (toggle-bitmap-pixel bitmap x y) -> T or NIL
  294.     
  295.     routines for drawing into bitmaps:
  296.         (with-focused-bitmap bitmap {form}*) -> bitmap    
  297.  
  298.     routines for copying bitmap data:
  299.         (plot-bitmap bitmap hpos vpos mode)
  300.  
  301.     a routine for converting pascal strings into bitmaps:
  302.         (string-to-bitmap the-string &optional the-font-spec) -> a bitmap
  303.         
  304.         
  305. SPECIFIC ROUTINE DESCRIPTIONS
  306.  
  307.  
  308. new-bitmap
  309.  
  310.     formal declaration:
  311.         (new-bitmap width height) -> a bitmap
  312.     
  313.     arguments:
  314.         width     the width of the requested bitmap
  315.         height    the height of the requested bitmap
  316.     
  317.     return value:
  318.         a pointer to a Bitmap data structure. 
  319.         if an error occurs, NULL is returned.
  320.         
  321.     description:
  322.         new-bitmap creates a new bitmap pointer with the requested
  323.         dimensions.  The raster data is initialized to zeros, and if
  324.         there is not enough memory to allocate the bitmap, NewBitMap
  325.         will return NULL.
  326.         
  327.     example application:
  328.         The following creates a new bitmap pointer 100 pixels wide
  329.         and 200 pixels tall.
  330.         
  331.         (let (mybits)
  332.            (setf mybits (new-bitmap 100 200))
  333.            ...
  334.            )
  335.             
  336.     notes:
  337.         You can call #_DisposePtr to dispose of a bitmap pointer created by
  338.         new-bitmap  The routine kill-bitmap calls #_DisposePtr.
  339.  
  340.  
  341. kill-bitmap
  342.  
  343.     formal declaration:
  344.         (kill-bitmap bitmap &rest other-bitmaps)
  345.     
  346.     arguments:
  347.         one or more bitmaps
  348.     
  349.     return value:
  350.         none.
  351.         
  352.     description:
  353.         kill-bitmap disposes of bitmaps allocated by:
  354.         
  355.         new-bitmap, duplicate-bitmap, rotate-bitmap-right, rotate-bitmap-left,
  356.         flip-bitmap-vertically, flip-bitmap-horizontally, rotate-bitmap,
  357.         paint-bucket-bitmap, lasso-bitmap, trace-bitmap-edges,
  358.         picture-to-bitmap, and-bitmaps, or-bitmaps, xor-bitmaps,
  359.         complement-bitmap, or string-to-bitmap.
  360.         
  361.         It's your general all purpose bitmap disposal function.
  362.  
  363.     example application:
  364.         The following creates a new bitmap pointer 100 pixels wide
  365.         and 200 pixels tall and then disposes of it by calling kill-bitmap
  366.         
  367.         (let (mybits)
  368.            (setf mybits (new-bitmap 100 200))
  369.            ...
  370.            (kill-bitmap mybits))
  371.             
  372.     notes:
  373.         kill-bitmap simply calls #_DisposePtr.
  374.  
  375.  
  376. rotate-bitmap-right
  377.  
  378.     formal declaration:
  379.         (rotate-bitmap-right bitmap) -> a bitmap
  380.     
  381.     arguments:
  382.         bits    a bitmap
  383.     
  384.     return value:
  385.         a newly created bitmap pointer containing the image
  386.         from the bitmap pointer parameter rotated 90 degrees
  387.         to the right. 
  388.         if an error occurs, rotate-bitmap-right will return the value NULL.
  389.         
  390.     description:
  391.         rotate-bitmap-right creates a new bitmap containing the image
  392.         stored in the parameter bitmap pointer rotated 90 degrees
  393.         to the right.  The resulting bitmap is appropriately sized:
  394.         i.e. if the source bitmap is 100 pixels wide and 200 pixels tall,
  395.         then the result bitmap pointer will be 200 pixels wide and 100
  396.         pixels tall.  
  397.  
  398.     example application:
  399.         The example creates a new bitmap pointer containing the image
  400.         stored in the original bitmap rotated 90 degrees to the right
  401.         before copying the image to the current grafport.
  402.         
  403.         (prog (the-bits rotated-bits)
  404.             
  405.            (setf the-bits (new-bitmap 100 200))
  406.            
  407.            ;; normally, we'd draw an image on the bitmap here
  408.  
  409.            (setf rotated-bits (rotate-bitmap-right the-bits))
  410.            
  411.            (plot-bitmap rotated_bits 0 0 #$srcCopy)
  412.            
  413.            (kill-bitmap the-bits rotated-bits))
  414.             
  415.     notes:
  416.         rotate-bitmap-right takes advantage of certain addressing and indexing
  417.         possibilities offered by the arrangement of the raster data
  418.         in memory.  It is faster than calling rotate-bitmap and specifying
  419.         a 90 degree angle.
  420.  
  421.  
  422. rotate-bitmap-left
  423.  
  424.     formal declaration:
  425.         (rotate-bitmap-left bitmap) -> a bitmap
  426.     
  427.     arguments:
  428.         bits    a bitmap pointer
  429.     
  430.     return value:
  431.         a newly created bitmap pointer containing the image
  432.         from the bitmap pointer parameter rotated 90 degrees
  433.         to the left. 
  434.         if an error occurs, rotate-bitmap-left will return the value NULL.
  435.         
  436.     description:
  437.         rotate-bitmap-left creates a new bitmap containing the image
  438.         stored in the parameter bitmap pointer rotated 90 degrees
  439.         to the left.  The resulting bitmap is appropriately sized:
  440.         i.e. if the source bitmap is 100 pixels wide and 200 pixels tall,
  441.         then the result bitmap pointer will be 200 pixels wide and 100
  442.         pixels tall.  
  443.  
  444.     example application:
  445.         The example creates a new bitmap pointer containing the image
  446.         stored in the original bitmap rotated 90 degrees to the left
  447.         before copying the image to the current grafport.
  448.         
  449.         (prog (the-bits rotated-bits)
  450.             
  451.            (setf the-bits (new-bitmap 100 200))
  452.            
  453.            ;; normally, we'd draw an image on the bitmap here
  454.  
  455.            (setf rotated-bits (rotate-bitmap-left the-bits))
  456.            
  457.            (plot-bitmap rotated_bits 0 0 #$srcCopy)
  458.            
  459.            (kill-bitmap the-bits rotated-bits))
  460.             
  461.     notes:
  462.         rotate-bitmap-left takes advantage of certain addressing and indexing
  463.         possibilities offered by the arrangement of the raster data
  464.         in memory.  It is faster than calling rotate-bitmap and specifying
  465.         a -90 degree angle.
  466.  
  467.  
  468. flip-bitmap-vertically
  469.  
  470.     formal declaration:
  471.         (flip-bitmap-vertically bitmap) -> a bitmap
  472.     
  473.     arguments:
  474.         bits    a bitmap pointer
  475.     
  476.     return value:
  477.         a newly created bitmap pointer containing the image
  478.         from the bitmap pointer parameter flipped upside down. 
  479.         if an error occurs, flip-bitmap-vertically will return the value NULL
  480.         
  481.     description:
  482.         flip-bitmap-vertically creates a new bitmap containing the image
  483.         stored in the parameter bitmap pointer flipped upside
  484.         down.  The resulting bitmap will be the same size as
  485.         the original image.  
  486.  
  487.     example application:
  488.         The example creates a new bitmap pointer containing the image
  489.         stored in the original bitmap flipped upside down before
  490.         copying the new flipped image to the current grafport.
  491.         
  492.         (prog (the-bits flippin-bits)
  493.             
  494.            (setf the-bits (new-bitmap 100 200))
  495.            
  496.            ;; normally, we'd draw an image on the bitmap here
  497.  
  498.            (setf flippin-bits (flip-bitmap-vertically the-bits))
  499.            
  500.            (plot-bitmap flippin-bits 0 0 #$srcCopy)
  501.            
  502.            (kill-bitmap the-bits flippin-bits))
  503.             
  504.     notes:
  505.         none.
  506.  
  507.  
  508. flip-bitmap-horizontally
  509.  
  510.     formal declaration:
  511.         (flip-bitmap-horizontally bitmap) -> a bitmap
  512.     
  513.     arguments:
  514.         bits    a bitmap pointer
  515.     
  516.     return value:
  517.         a newly created bitmap pointer containing the image
  518.         from the bitmap pointer parameter flipped horizontally. 
  519.         if an error occurs, flip-bitmap-horizontally will return the value NULL.
  520.         
  521.     description:
  522.         flip-bitmap-horizontally creates a new bitmap containing the image
  523.         stored in the parameter bitmap pointer flipped horizontally.
  524.         The resulting bitmap will be the same size as the original image.  
  525.  
  526.     example application:
  527.         The example creates a new bitmap pointer containing the image
  528.         stored in the original bitmap flipped horizontally before
  529.         copying the new flipped image to the current grafport.
  530.         
  531.         (prog (the-bits flippin-bits)
  532.             
  533.            (setf the-bits (new-bitmap 100 200))
  534.            
  535.            ;; normally, we'd draw an image on the bitmap here
  536.  
  537.            (setf flippin-bits (flip-bitmap-horizontally the-bits))
  538.            
  539.            (plot-bitmap flippin-bits 0 0 #$srcCopy)
  540.            
  541.            (kill-bitmap the-bits flippin-bits))
  542.             
  543.     notes:
  544.         none.
  545.  
  546.  
  547. rotate-bitmap
  548.  
  549.     formal declaration:
  550.         (rotate-bitmap bitmap h-center v-center angle) -> a bitmap
  551.     
  552.     arguments:
  553.         bits      a bitmap pointer
  554.         cx        the horizontal center of rotation
  555.         cy        the vertical center of rotation
  556.         angle     the angle (in degrees) to rotate the image. both positive
  557.                   and negative values are ok.  This is an integer number.
  558.                 
  559.     return value:
  560.         a newly created bitmap pointer containing the image
  561.         from the bitmap pointer parameter rotated around the center
  562.         cx and cy angle degrees. 
  563.         if an error occurs, rotate-bitmap will return the value NULL.
  564.         
  565.     description:
  566.         rotate-bitmap creates a new bitmap containing the image from
  567.         the parameter bitmap pointer rotated angle degrees about the
  568.         center (cx, cy).  The resultant bitmap will have the same dimensions
  569.         as the parameter bitmap regardless of the angle specified.
  570.  
  571.     example application:
  572.         The example creates a new bitmap pointer containing the image
  573.         stored in the original bitmap rotated 35 degrees to the right
  574.         before copying the rotated image to the current grafport.
  575.         
  576.         (prog (the-bits round-bits)
  577.             
  578.            (setf the-bits (new-bitmap 100 200))
  579.            
  580.            ;; normally, we'd draw an image on the bitmap here
  581.  
  582.            (setf round-bits (rotate-bitmap the-bits 50 50 35))
  583.            
  584.            (plot-bitmap round-bits 0 0 #$srcCopy)
  585.            
  586.            (kill-bitmap the-bits round-bits))
  587.             
  588.     notes:
  589.         rotate-bitmap has a speedy implementation built on top of the
  590.         fixed math routines.  For more information about fixed math
  591.         refer to the Mathematical and Logical Utilities chapter of
  592.         Inside Macintosh: Operating System Utilities.
  593.  
  594.  
  595. duplicate-bitmap
  596.  
  597.     formal declaration:
  598.         (duplicate-bitmap bitmap) -> a bitmap
  599.     
  600.     arguments:
  601.         bits    a bitmap pointer
  602.     
  603.     return value:
  604.         a newly created bitmap pointer containing an
  605.         exact duplicate of the bitmap parameter.
  606.         if an error occurs, duplicate-bitmap will return the value NULL.
  607.         
  608.     description:
  609.         duplicate-bitmap creates a copy of the bitmap parameter.
  610.  
  611.     example application:
  612.         In this example, we make a new bitmap, duplicate it, put it
  613.         on the screen, and then dispose of the resulting bitmaps.
  614.         
  615.         (prog (the-bits extra-bits)
  616.             
  617.            (setf the-bits (new-bitmap 100 200))
  618.            
  619.            ;; normally, we'd draw an image on the bitmap here
  620.  
  621.            (setf extra-bits (duplicate-bitmap the-bits 50 50 35))
  622.            
  623.            (plot-bitmap extra-bits 0 0 #$srcCopy)
  624.            
  625.            (kill-bitmap the-bits extra-bits))
  626.             
  627.     notes:
  628.         none.
  629.  
  630.  
  631. paint-bucket-bitmap
  632.  
  633.     formal declaration:
  634.         (paint-bucket-bitmap bitmap h v) -> a bitmap
  635.     
  636.     arguments:
  637.         bits     a bitmap pointer
  638.         h         the horizontal position to start painting
  639.         v         the vertical position to start painting
  640.     
  641.     return value:
  642.         a newly created bitmap pointer containing an ones in every
  643.         pixel where paint would not leak out starting from the point
  644.         (h, v).
  645.         if an error occurs, paint-bucket-bitmap will return the value NULL.
  646.         
  647.     description:
  648.         paint-bucket-bitmap works like the paint bucket tool found in
  649.         most graphical applications.  It calls the routine SeedFill
  650.         and to fill in the image information in the resulting bitmap
  651.         pointer.
  652.  
  653.     example application:
  654.         In this example, we make a new bitmap and create a mask bitmap
  655.         using the paint-bucket-bitmap routine starting at the point (50,50).
  656.         
  657.         (prog (the-bits painted-bits)
  658.             
  659.            (setf the-bits (new-bitmap 100 200))
  660.            
  661.            ;; normally, we'd draw an image on the bitmap here
  662.  
  663.            (setf painted-bits (paint-bucket-bitmap the-bits 50 50))
  664.            
  665.            (plot-bitmap painted-bits 0 0 #$srcCopy)
  666.            
  667.            (kill-bitmap the-bits painted-bits))
  668.             
  669.     notes:
  670.         paint-bucket-bitmap calls SeedFill.  For further information about
  671.         SeedFill refer to page 3-109 in the QuickDraw Drawing chapter of
  672.         Inside Macintosh: Imaging With QuickDraw.
  673.  
  674.  
  675. lasso-bitmap
  676.  
  677.     formal declaration:
  678.         (lasso-bitmap bitmap) -> a bitmap
  679.     
  680.     arguments:
  681.         bits    a bitmap pointer
  682.     
  683.     return value:
  684.         a newly created bitmap pointer containing an ones in every
  685.         pixel where paint would not leak in from the edges of the
  686.         bitmap.
  687.         if an error occurs, lasso-bitmap will return the value NULL.
  688.         
  689.     description:
  690.         lasso-bitmap works like the lasso bucket tool found in
  691.         most graphical applications.  It calls the routine CalcMask
  692.         and to fill in the image information in the resulting bitmap
  693.         pointer.
  694.  
  695.     example application:
  696.         In this example, we make a new bitmap and create a mask bitmap
  697.         using the lasso-bitmap routine.
  698.         
  699.         (prog (the-bits lasso-bits)
  700.             
  701.            ;; create a new bitmap
  702.            (setf the-bits (new-bitmap 100 200))
  703.            
  704.            ;; normally, we'd draw an image on the bitmap here
  705.  
  706.            ;; create a mask for the image
  707.            (setf lasso-bits (lasso-bitmap the-bits 50 50))
  708.            
  709.            ;; plot the mask on the screen
  710.            (plot-bitmap lasso-bits 0 0 #$srcCopy)
  711.            
  712.            ;; recover the storage
  713.            (kill-bitmap the-bits lasso-bits))
  714.             
  715.     notes:
  716.         lasso-bitmap calls CalcMask.  For further information about
  717.         CalcMask refer to page 3-111 in the QuickDraw Drawing chapter of
  718.         Inside Macintosh: Imaging With QuickDraw.
  719.  
  720.  
  721. trace-bitmap-edges
  722.  
  723.     formal declaration:
  724.         (trace-bitmap-edges bitmap) -> a bitmap
  725.     
  726.     arguments:
  727.         bits    a bitmap pointer
  728.     
  729.     return value:
  730.         a newly created bitmap pointer containing containing the original
  731.         image with the edges traced.
  732.         if an error occurs, trace-bitmap-edges will return the value NULL.
  733.         
  734.     description:
  735.         trace-bitmap-edges performs the 'trace edges' command found in
  736.         many graphical applications returning a new bitmap
  737.         containing the traced image..
  738.  
  739.     example application:
  740.         In this example, we make a new bitmap and create a new bitmap
  741.         containing the traced image.
  742.         
  743.         (prog (the-bits traced-bits)
  744.             
  745.            ;; create a new bitmap
  746.            (setf the-bits (new-bitmap 100 200))
  747.            
  748.            ;; normally, we'd draw an image on the bitmap here
  749.  
  750.            ;; create a mask for the image
  751.            (setf traced-bits (trace-bitmap-edges the-bits))
  752.            
  753.            ;; plot the new image on the screen
  754.            (plot-bitmap traced-bits 0 0 #$srcCopy)
  755.            
  756.            ;; recover the storage
  757.            (kill-bitmap the-bits traced-bits))
  758.             
  759.     notes:
  760.         none.
  761.  
  762.  
  763. equal-bitmaps
  764.  
  765.     formal declaration:
  766.         (equal-bitmaps bitmap-a bitmap-b) -> T or NIL
  767.     
  768.     arguments:
  769.         a    a bitmap pointer
  770.         b    a bitmap pointer
  771.     
  772.     return value:
  773.         T or NIL
  774.         
  775.     description:
  776.         returns T if the two bitmaps are the same size and
  777.         contain the same image content.  returns NIL if either
  778.         bitmap is NULL.
  779.  
  780.     example application:
  781.         In this example, we make a new bitmap and create a two bitmaps
  782.         and compare them by calling equal-bitmaps
  783.         
  784.         (prog (bitmap-one bitmap-two)
  785.             
  786.            ;; make some bitmaps
  787.            (setf bitmap-one (new-bitmap 100 200))
  788.            (setf bitmap-two (new-bitmap 100 200))
  789.            
  790.            ;; normally, we'd draw some images on the bitmaps here
  791.  
  792.            (if (equal-bitmaps bitmap-one bitmap-two)
  793.               (princ "the bitmaps, they are the same!")
  794.               (princ "the bitmaps, they are not the same!"))
  795.            (terpri)
  796.            
  797.            ;; recover the storage
  798.            (kill-bitmap bitmap-one bitmap-two))
  799.             
  800.     notes:
  801.         equal-bitmaps takes into account that either bitmap may have
  802.         different rowBytes values, and the possibility that garbage
  803.         values may be stored in the unused bits off to the right
  804.         of the boundary rectangle.
  805.  
  806.  
  807. picture-to-bitmap
  808.  
  809.     formal declaration:
  810.         (picture-to-bitmap bitmap) -> a bitmap
  811.     
  812.     arguments:
  813.         pic        a handle to a QuickDraw picture
  814.     
  815.     return value:
  816.         a newly created bitmap pointer containing a black and white
  817.         representation of the image drawn by the quickdraw picture
  818.         parameter.
  819.         if an error occurs, picture-to-bitmap will return the value NULL.
  820.         
  821.     description:
  822.         picture-to-bitmap creates a new bitmap pointer the using the size
  823.         information provided in the QuickDraw picture pointer parameter
  824.         and draws the picture in the bitmap before returning the bitmap.
  825.  
  826.     example application:
  827.         In this example, we call GetPicture to retrieve a picture from
  828.         a resource file and then we convert it to a bitmap by calling
  829.         the routine picture-to-bitmap
  830.         
  831.         (prog (the-bits the-picture)
  832.             
  833.            ;; get a picture resource
  834.            (setf the-picture (#_GetPicture 128))
  835.  
  836.            ;; convert it into a bitmap
  837.            (setf the-bits (picture-to-bitmap the-picture))
  838.            
  839.            ;; plot the new image on the screen
  840.            (plot-bitmap the-bits 0 0 #$srcCopy)
  841.            
  842.            ;; recover the storage
  843.            (kill-bitmap the-bits))
  844.             
  845.     notes:
  846.         none.
  847.  
  848.  
  849. bitmap-to-picture
  850.  
  851.     formal declaration:
  852.         (bitmap-to-picture bitmap) -> a picture handle
  853.     
  854.     arguments:
  855.         bits    a bitmap pointer
  856.     
  857.     return value:
  858.         a handle to a QuickDraw picture. 
  859.         if an error occurs, the picture's picFrame will be
  860.         an empty rectangle.
  861.         
  862.     description:
  863.         bitmap-to-picture returns a QuickDraw picture that will draw the
  864.         image stored in the bitmap.  bitmap-to-picture is the inverse
  865.         of picture-to-bitmap
  866.  
  867.     example application:
  868.         In this example, we create a bitmap and convert it into a QuickDraw
  869.         picture.
  870.         
  871.         (prog (the-bits the-picture)
  872.             
  873.            ;; create a new bitmap
  874.            (setf the-bits (new-bitmap 100 200))
  875.            
  876.            ;; normally, we'd draw an image on the bitmap here
  877.  
  878.            ;; turn the bitmap into a picture
  879.            (setf the-picture (bitmap-to-picture the-bits))
  880.            
  881.            ;; store the picture to the clipboard or somewhere appropriate
  882.            ...
  883.            
  884.            ;; recover the storage
  885.            (kill-bitmap the-bits))
  886.             
  887.     notes:
  888.         QuickDraw pictures are a good way to store image data.
  889.  
  890.  
  891. and-bitmaps
  892.  
  893.     formal declaration:
  894.         (and-bitmaps bitmap-a bitmap-b) -> a bitmap
  895.     
  896.     arguments:
  897.         a        a bitmap pointer
  898.         b        a bitmap pointer
  899.     
  900.     return value:
  901.         a bitmap pointer containing the logical result of ANDing the
  902.         raster data from bitmap a with the raster data from bitmap b. 
  903.         if an error occurs, NULL is returned.
  904.         
  905.     description:
  906.         and-bitmaps logically ANDs the raster data of two bitmap pointers
  907.         returning a new bitmap pointer containing the result.  The two
  908.         parameter bitmaps must have identical dimensions.
  909.  
  910.     example application:
  911.         In this example, we create two bitmaps and AND them together creating
  912.         a third bitmap.
  913.         
  914.         (prog (a b c)
  915.             
  916.            ;; create a new bitmap
  917.            (setf a (new-bitmap 100 100))
  918.            (setf b (new-bitmap 100 100))
  919.  
  920.            ;; normally, we'd draw into the bitmaps here
  921.  
  922.            ;; and the two bitmaps together
  923.            (setf c (and-bitmaps a b))
  924.            
  925.            ;; plot the new image on the screen
  926.            (plot-bitmap c 0 0 #$srcCopy)
  927.            
  928.            ;; recover the storage
  929.            (kill-bitmap a b c))
  930.         
  931.     notes:
  932.         useful for calculating the intersection of two sets of bits.
  933.  
  934.  
  935. or-bitmaps
  936.  
  937.     formal declaration:
  938.         (or-bitmaps bitmap-a bitmap-b) -> a bitmap
  939.     
  940.     arguments:
  941.         a        a bitmap pointer
  942.         b        a bitmap pointer
  943.     
  944.     return value:
  945.         a bitmap pointer containing the logical result of ORing the
  946.         raster data from bitmap a with the raster data from bitmap b. 
  947.         if an error occurs, NULL is returned.
  948.         
  949.     description:
  950.         or-bitmaps logically ORs the raster data of two bitmap pointers
  951.         returning a new bitmap pointer containing the result.  The two
  952.         parameter bitmaps must have identical dimensions.
  953.  
  954.     example application:
  955.         In this example, we create two bitmaps and OR them together creating
  956.         a third bitmap.
  957.         
  958.         (prog (a b c)
  959.             
  960.            ;; create a new bitmap
  961.            (setf a (new-bitmap 100 100))
  962.            (setf b (new-bitmap 100 100))
  963.  
  964.            ;; normally, we'd draw into the bitmaps here
  965.  
  966.            ;; and the two bitmaps together
  967.            (setf c (or-bitmaps a b))
  968.            
  969.            ;; plot the new image on the screen
  970.            (plot-bitmap c 0 0 #$srcCopy)
  971.            
  972.            ;; recover the storage
  973.            (kill-bitmap a b c))
  974.         
  975.     notes:
  976.         useful for calculating the union of two sets of bits.
  977.  
  978.  
  979. xor-bitmaps
  980.  
  981.     formal declaration:
  982.         (xor-bitmaps bitmap-a bitmap-b) -> a bitmap
  983.     
  984.     arguments:
  985.         a        a bitmap pointer
  986.         b        a bitmap pointer
  987.     
  988.     return value:
  989.         a bitmap pointer containing the logical result of XORing the
  990.         raster data from bitmap a with the raster data from bitmap b. 
  991.         if an error occurs, NULL is returned.
  992.         
  993.     description:
  994.         xor-bitmaps logically XORs the raster data of two bitmap pointers
  995.         returning a new bitmap pointer containing the result.  The two
  996.         parameter bitmaps must have identical dimensions.
  997.  
  998.     example application:
  999.         In this example, we create two bitmaps and XOR them together creating
  1000.         a third bitmap.
  1001.         
  1002.         (prog (a b c)
  1003.             
  1004.            ;; create a new bitmap
  1005.            (setf a (new-bitmap 100 100))
  1006.            (setf b (new-bitmap 100 100))
  1007.  
  1008.            ;; normally, we'd draw into the bitmaps here
  1009.  
  1010.            ;; and the two bitmaps together
  1011.            (setf c (xor-bitmaps a b))
  1012.            
  1013.            ;; plot the new image on the screen
  1014.            (plot-bitmap c 0 0 #$srcCopy)
  1015.            
  1016.            ;; recover the storage
  1017.            (kill-bitmap a b c))
  1018.         
  1019.     notes:
  1020.         useful for calculating the difference of two sets of bits.
  1021.  
  1022.  
  1023. complement-bitmap
  1024.  
  1025.     formal declaration:
  1026.         (complement-bitmap bitmap) -> a bitmap
  1027.     
  1028.     arguments:
  1029.         a        a bitmap pointer
  1030.     
  1031.     return value:
  1032.         a bitmap pointer containing the logical result of complementing the
  1033.         raster data from bitmap a. 
  1034.         if an error occurs, NULL is returned.
  1035.         
  1036.     description:
  1037.         complement-bitmap returns a new bitmap pointer containing the inverse
  1038.         of the raster image contained in the bitmap pointer a.
  1039.  
  1040.     example application:
  1041.         In this example, we create a bitmap and it's complement.
  1042.         
  1043.         (prog (a b)
  1044.             
  1045.            ;; create a new bitmap
  1046.            (setf a (new-bitmap 100 100))
  1047.  
  1048.            ;; normally, we'd draw into the bitmaps here
  1049.  
  1050.            ;; and the two bitmaps together
  1051.            (setf b (complement-bitmap a))
  1052.            
  1053.            ;; plot the new image on the screen
  1054.            (plot-bitmap b 0 0 #$srcCopy)
  1055.            
  1056.            ;; recover the storage
  1057.            (kill-bitmap a b))
  1058.         
  1059.     notes:
  1060.         useful for calculating the complement of a set of bits.
  1061.  
  1062.  
  1063. test-bitmap-pixel
  1064.  
  1065.     formal declaration:
  1066.         (test-bitmap-pixel bitmap x y) -> T or NIL
  1067.     
  1068.     arguments:
  1069.         bits     a bitmap pointer
  1070.         h        the horizontal position of the pixel to test
  1071.         v        the vertical position of the pixel to test
  1072.         
  1073.     return value:
  1074.         T if the pixel is 1, NIL if the pixel is 0.
  1075.         
  1076.     description:
  1077.         test-bitmap-pixel tests the value of the pixel at the location (h,v)
  1078.         returning T if the pixel is 1, and NIL if the pixel
  1079.         is zero.
  1080.  
  1081.     example application:
  1082.         In this example, we create a bitmap and test the pixel
  1083.         located at (25, 32).
  1084.         
  1085.         (prog (the-bits)
  1086.             
  1087.            ;; create a new bitmap
  1088.            (setf the-bits (new-bitmap 100 100))
  1089.  
  1090.            ;; normally, we'd draw into the bitmaps here
  1091.  
  1092.            ;; and the two bitmaps together
  1093.            (if (test-bitmap-pixel the-bits 25 32)
  1094.               (princ "The pixel has the value one!")
  1095.                (princ "The pixel has the value zero"))
  1096.            
  1097.            ;; recover the storage
  1098.            (kill-bitmap the-bits))
  1099.  
  1100.     notes:
  1101.         attempting to test a point outside of the bitmap's bounds
  1102.         will produce unpredictable results.
  1103.  
  1104.  
  1105. set-bitmap-pixel
  1106.  
  1107.     formal declaration:
  1108.         (set-bitmap-pixel bitmap hpos vpos)
  1109.     
  1110.     arguments:
  1111.         bits     a bitmap pointer
  1112.         h        the horizontal position of the pixel to set
  1113.         v        the vertical position of the pixel to set
  1114.     
  1115.     return value:
  1116.         none.
  1117.         
  1118.     description:
  1119.         set-bitmap-pixel sets the value of the pixel at the location (h,v) to 1.
  1120.  
  1121.     example application:
  1122.         In this example, we create a bitmap and set the pixel
  1123.         located at (25, 32) to the value 1.
  1124.         
  1125.         (prog (the-bits)
  1126.             
  1127.            ;; create a new bitmap
  1128.            (setf the-bits (new-bitmap 100 100))
  1129.  
  1130.            ;; set the pixel
  1131.            (set-bitmap-pixel the-bits 25 32)
  1132.  
  1133.            ;; and the two bitmaps together
  1134.            (if (test-bitmap-pixel the-bits 25 32)
  1135.               (princ "The pixel has the value one!")
  1136.                (princ "The pixel has the value zero"))
  1137.            
  1138.            ;; recover the storage
  1139.            (kill-bitmap the-bits))
  1140.  
  1141.     notes:
  1142.         attempting to set a pixel outside of the bitmap's bounds
  1143.         will produce unpredictable results and may even crash your
  1144.         computer by overwriting something important like the operating
  1145.         system or your program or something like that.
  1146.  
  1147.  
  1148. clear-bitmap-pixel
  1149.  
  1150.     formal declaration:
  1151.         (clear-bitmap-pixel bitmap hpos vpos)
  1152.     
  1153.     arguments:
  1154.         bits     a bitmap pointer
  1155.         h        the horizontal position of the pixel to set
  1156.         v        the vertical position of the pixel to set
  1157.     
  1158.     return value:
  1159.         none.
  1160.         
  1161.     description:
  1162.         clear-bitmap-pixel clears the value of the pixel at the location (h,v)
  1163.         to 0.
  1164.  
  1165.     example application:
  1166.         In this example, we create a bitmap and set the pixel
  1167.         located at (25, 32) to the value 0.
  1168.         
  1169.         (prog (the-bits)
  1170.             
  1171.            ;; create a new bitmap
  1172.            (setf the-bits (new-bitmap 100 100))
  1173.  
  1174.            ;; set the pixel
  1175.            (clear-bitmap-pixel the-bits 25 32)
  1176.  
  1177.            ;; and the two bitmaps together
  1178.            (if (test-bitmap-pixel the-bits 25 32)
  1179.               (princ "The pixel has the value one!")
  1180.                (princ "The pixel has the value zero"))
  1181.            
  1182.            ;; recover the storage
  1183.            (kill-bitmap the-bits))
  1184.  
  1185.     notes:
  1186.         attempting to clear a pixel outside of the bitmap's bounds
  1187.         will produce unpredictable results and may even crash your
  1188.         computer by overwriting something important like the operating
  1189.         system or your program or something like that.
  1190.  
  1191.  
  1192. toggle-bitmap-pixel
  1193.  
  1194.     formal declaration:
  1195.         (toggle-bitmap-pixel bitmap x y) -> T or NIL
  1196.     
  1197.     arguments:
  1198.         bits     a bitmap pointer
  1199.         h        the horizontal position of the pixel to set
  1200.         v        the vertical position of the pixel to set
  1201.     
  1202.     return value:
  1203.         a boolean value indicating the state of the pixel
  1204.         after the toggle operation.  i.e. if the pixel is
  1205.         set to the value 1, T is returned.  If the pixel
  1206.         is set to the value 0, NIL is returned.
  1207.         
  1208.     description:
  1209.         BitMapToggle inverts the value of the pixel at the location (h,v)
  1210.         returning T if the pixel is set to 1 or NIL if the pixel
  1211.         is set to 0.
  1212.  
  1213.     example application:
  1214.         In this example, we create a bitmap and invert the pixel
  1215.         located at (25, 32).
  1216.         
  1217.         (prog (the-bits)
  1218.             
  1219.            ;; create a new bitmap
  1220.            (setf the-bits (new-bitmap 100 100))
  1221.  
  1222.            ;; and the two bitmaps together
  1223.            (if (toggle-bitmap-pixel the-bits 25 32)
  1224.               (princ "The pixel has the value one!")
  1225.                (princ "The pixel has the value zero"))
  1226.            
  1227.            ;; recover the storage
  1228.            (kill-bitmap the-bits))
  1229.  
  1230.     notes:
  1231.         attempting to toggle a pixel outside of the bitmap's bounds
  1232.         will produce unpredictable results and may even crash your
  1233.         computer by overwriting something important like the operating
  1234.         system or your program or something like that.
  1235.  
  1236.  
  1237. with-focused-bitmap
  1238.  
  1239.     formal declaration:
  1240.         (with-focused-bitmap bitmap {form}*) -> bitmap
  1241.     
  1242.     arguments:
  1243.         bitmap     a bitmap pointer
  1244.          {form}*       forms executed that draw into the bitmap
  1245.     
  1246.     return value:
  1247.         the bitmap parameter is returned
  1248.         
  1249.     description:
  1250.         with-focused-bitmap is a macro facility that sets up the drawing
  1251.         environment such that any drawing commands in the statement
  1252.         following the macro instantiation will draw into the bitmap
  1253.         provided as the first parameter.
  1254.  
  1255.     example application:
  1256.         In this example, we create a bitmap and use the with-focused-bitmap
  1257.         macro to do some drawing in it.
  1258.         
  1259.         (prog (the-bits)
  1260.             
  1261.            ;; create a new bitmap
  1262.            (setf the-bits (new-bitmap 100 100))
  1263.  
  1264.            ;; draw into the bitmap
  1265.            (with-focused-bitmap (the-bits)
  1266.                (#_MoveTo 10 10)
  1267.                (#_LineTo 90 90))
  1268.            
  1269.            ;; recover the storage
  1270.            (kill-bitmap the-bits))
  1271.  
  1272.     notes:
  1273.         none.
  1274.  
  1275.  
  1276. plot-bitmap
  1277.  
  1278.     formal declaration:
  1279.         (plot-bitmap bitmap hpos vpos mode)
  1280.     
  1281.     arguments:
  1282.         bits        a bitmap pointer
  1283.         h           the horizontal location where the bitmap is drawn
  1284.         v           the horizontal location where the bitmap is drawn
  1285.         mode        transfer mode passed to copybits
  1286.     
  1287.     return value:
  1288.         none.
  1289.         
  1290.     description:
  1291.         plot-bitmap provides a simple interface for drawing a bitmap in
  1292.         the current grafport.  The bitmap is drawn with the top left corner
  1293.         aligned with the point (h,v) using the indicated transfer mode.
  1294.         mode is one of:
  1295.         #$srcCopy #$srcOr #$srcXor #$srcBic #$notSrcCopy
  1296.         #$notSrcOr #$notSrcXor #$notSrcBic #$patCopy #$patOr #$patXor
  1297.         #$patBic #$notPatCopy #$notPatOr #$notPatXor #$notPatBic
  1298.  
  1299.     example application:
  1300.         In this example, we create a bitmap and use the WithBitMap
  1301.         macro to do some drawing in it, and then we copy the result
  1302.         to the current grafport at the location (75, 23) using the
  1303.         plot-bitmap routine.
  1304.         
  1305.         (prog (the-bits)
  1306.             
  1307.            ;; create a new bitmap
  1308.            (setf the-bits (new-bitmap 100 100))
  1309.  
  1310.            ;; draw into the bitmap
  1311.            (with-focused-bitmap (the-bits)
  1312.                (#_MoveTo 10 10)
  1313.                (#_LineTo 90 90))
  1314.            
  1315.            ;; draw it on the screen
  1316.            (plot-bitmap the-bits 75 23 #$srcCopy)
  1317.  
  1318.            ;; recover the storage
  1319.            (kill-bitmap the-bits))
  1320.  
  1321.     notes:
  1322.         plot-bitmap calls CopyBits.
  1323.  
  1324.  
  1325. string-to-bitmap
  1326.  
  1327.     formal declaration:
  1328.         (string-to-bitmap the-string &optional the-font-spec) -> a bitmap
  1329.     
  1330.     arguments:
  1331.         the-string           a string
  1332.         the-font-spec      an optional font specification
  1333.  
  1334.     return value:
  1335.         a bitmap pointer
  1336.         
  1337.     description:
  1338.         string-to-bitmap converts the string pointed to by s into a bitmap
  1339.         drawing the string onto an appropriately sized bitmap for the
  1340.         given font specification  string-to-bitmap is useful for
  1341.         converting strings to bitmap so rotation can be applied with
  1342.         rotate-bitmap-left or rotate-bitmap-right before it is displayed.
  1343.         string-to-bitmap preserves the current grafport.  if
  1344.         the-font-spec is not provided, the system font will be used.
  1345.  
  1346.     example application:
  1347.         In this example, we create a bitmap pointer containing
  1348.         the string "Hello World" (using bold, underlined,
  1349.         24 point geneva font), rotate it 90 degrees to the
  1350.         right, and draw the result in the current grafport
  1351.         at the location (110,34) using the plot-bitmap routine.
  1352.         
  1353.         (prog (the-bits rotated-bits)
  1354.             
  1355.             ;; create a new bitmap
  1356.             (setf the-bits (string-to-bitmap "Hello World" '("Geneva" 24 :bold :underline)))
  1357.             
  1358.             ;; rotate the string
  1359.             (setf rotated-bits (rotate-bitmap-right the-bits))
  1360.             
  1361.             ;; draw it on the screen
  1362.             (plot-bitmap rotated-bits 110 34 #$srcCopy)
  1363.             
  1364.             ;; recover the storage
  1365.             (kill-bitmap the-bits rotated-bits))
  1366.  
  1367.     notes:
  1368.         none.
  1369.  
  1370.  
  1371. get-bitmap-width
  1372.  
  1373.     formal declaration:
  1374.         (get-bitmap-width bitmap) -> the width
  1375.     
  1376.     arguments:
  1377.         bitmap           a bitmap
  1378.  
  1379.     return value:
  1380.         the width of the bitmap
  1381.         
  1382.     description:
  1383.         get-bitmap-width is a convenience routine that returns
  1384.         the width of a bitmap.
  1385.  
  1386.     notes:
  1387.         none.
  1388.  
  1389.  
  1390. get-bitmap-height
  1391.  
  1392.     formal declaration:
  1393.         (get-bitmap-height bitmap) -> the height
  1394.     
  1395.     arguments:
  1396.         bitmap           a bitmap
  1397.  
  1398.     return value:
  1399.         the height of the bitmap
  1400.         
  1401.     description:
  1402.         get-bitmap-width is a convenience routine that returns
  1403.         the height of a bitmap.
  1404.  
  1405.     notes:
  1406.         none.
  1407.  
  1408.  
  1409. file BitMapLisp.txt Copyright (C) 1996 by John Montbriand.  All Rights Reserved.
  1410.  
  1411. end of file
  1412.